<!--
 -
 - Licensed to the Apache Software Foundation (ASF) under one
 - or more contributor license agreements.  See the NOTICE file
 - distributed with this work for additional information
 - regarding copyright ownership.  The ASF licenses this file
 - to you under the Apache License, Version 2.0 (the
 - "License"); you may not use this file except in compliance
 - with the License.  You may obtain a copy of the License at
 -
 -   http://www.apache.org/licenses/LICENSE-2.0
 -
 - Unless required by applicable law or agreed to in writing,
 - software distributed under the License is distributed on an
 - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 - KIND, either express or implied.  See the License for the
 - specific language governing permissions and limitations
 - under the License.
 -
 -->
<div class="dijitHidden">
    <div data-dojo-type="dijit.Dialog" data-dojo-props="title:'Add Queue'" id="addQueue">
        <form id="formAddQueue" method="post" dojoType="dijit.form.Form">

            <div class="clear">
                <div class="formLabel-labelCell">Queue Name*:</div>
                <div class="formLabel-controlCell">
                    <input type="text" id="formAddQueue.name"
                           data-dojo-type="dijit/form/ValidationTextBox"
                           data-dojo-props="
                                  name: 'name',
                                  placeHolder: 'queue name',
                                  required: true,
                                  promptMessage: 'Name of queue',
                                  title: 'Enter a queue name',
                                  regExp:'^[\x20-\x7F]{1,255}$'"/>
                </div>
            </div>
            <div class="clear">
                <div class="formLabel-labelCell">Queue Type:</div>
                <div class="formLabel-controlCell">
                    <select id="formAddQueue.type"
                            dojoType="dijit.form.FilteringSelect"
                            data-dojo-props="
                              name: 'type',
                              value: 'standard',
                              searchAttr: 'name',
                              required: true,
                              promptMessage: 'Type of Queue',
                              title: 'Enter the queue type'">
                        <option value="standard">Standard</option>
                        <option value="priority">Priority</option>
                        <option value="lvq">LVQ</option>
                        <option value="sorted">Sorted</option>
                    </select>
                </div>
            </div>
            <div class="clear"></div>

            <div id="formAddQueueType:priority" class="hidden typeSpecificDiv">
                <div class="clear">
                    <div class="formLabel-labelCell">Priorities:</div>
                    <div class="formLabel-controlCell">
                        <input type="text" id="formAddQueue.priorities"
                               data-dojo-type="dijit/form/ValidationTextBox"
                               data-dojo-props="
                                  name: 'priorities',
                                  placeHolder: 'number of priorities',
                                  promptMessage: 'Number of priorities supported by the queue',
                                  title: 'Enter the number of priorities supported by the queue',
                                  trim: true"/>
                    </div>
                </div>
                <div class="clear"></div>
            </div>

            <div id="formAddQueueType:lvq" class="hidden typeSpecificDiv">
                <div class="clear">
                    <div class="formLabel-labelCell">LVQ Message Property:</div>
                    <div class="formLabel-controlCell">
                        <input type="text" id="formAddQueue.lvqKey"
                               data-dojo-type="dijit/form/ValidationTextBox"
                               data-dojo-props="
                                  name: 'lvqKey',
                                  placeHolder: 'lvq key',
                                  promptMessage: 'Name of the message property used to perform the conflation',
                                  title: 'Enter the name of the message property used to perform the conflation',
                                  trim: true"/>
                    </div>
                </div>
                <div class="clear"></div>
            </div>

            <div id="formAddQueueType:sorted" class="hidden typeSpecificDiv">
                <div class="clear">
                    <div class="formLabel-labelCell">Sort Message Property*:</div>
                    <div class="formLabel-controlCell">
                        <input type="text" id="formAddQueue.sortKey"
                               data-dojo-type="dijit/form/ValidationTextBox"
                               data-dojo-props="
                                  name: 'sortKey',
                                  placeHolder: 'sort key',
                                  promptMessage: 'Name of the message property used for sorting the messages on the queue',
                                  title: 'Enter the name of the message property used for sorting the messages on the queue',
                                  trim: true"/>
                    </div>
                </div>
                <div class="clear"></div>
            </div>

            <div class="clear">
                <div class="formLabel-labelCell">Durable?</div>
                <div class="formLabel-controlCell">
                    <input type="checkbox" id="formAddQueue.durable"
                           dojoType="dijit.form.CheckBox"
                           data-dojo-props="
                              name: 'durable',
                              value: 'durable',
                              checked: true"/>
                </div>
            </div>
            <div class="clear">
                <div class="formLabel-labelCell">Persist Messages?</div>
                <div class="formLabel-controlCell">
                    <select id="formAddQueue.messageDurability"
                            dojoType="dijit.form.FilteringSelect"
                            data-dojo-props="
                              name: 'messageDurability',
                              value: '',
                              searchAttr: 'name',
                              required: false,
                              promptMessage: 'Message persistence override. If not default, messages arriving will have persistence setting overridden',
                              title: 'Enter message persistence override'">
                        <option value="ALWAYS">Always</option>
                        <option value="DEFAULT">Default</option>
                        <option value="NEVER">Never</option>
                    </select>
                </div>
            </div>
            <div class="clear">
                <div class="formLabel-labelCell">Maximum Ttl:</div>
                <div class="formLabel-controlCell">
                    <input type="text" id="formAddQueue.maximumMessageTtl"
                           data-dojo-type="dijit/form/ValidationTextBox"
                           data-dojo-props="
                                  name: 'maximumMessageTtl',
                                  placeHolder: 'ttl in ms',
                                  promptMessage: 'Maximum message time to live (ttl) in ms. Messages arriving with larger ttl values will be overridden by this value',
                                  title: 'Enter the maximum message time to live in milliseconds',
                                  trim: true"/>
                </div>
            </div>
            <div class="clear">
                <div class="formLabel-labelCell">Minimum Ttl:</div>
                <div class="formLabel-controlCell">
                    <input type="text" id="formAddQueue.minimumMessageTtl"
                           data-dojo-type="dijit/form/ValidationTextBox"
                           data-dojo-props="
                                  name: 'minimumMessageTtl',
                                  placeHolder: 'ttl in ms',
                                  promptMessage: 'Minimum message time to live (ttl) in ms. Messages arriving with smaller ttl values will be overridden by this value',
                                  title: 'Enter the minimum message time to live in milliseconds',
                                  trim: true"/>
                </div>
            </div>

            <div class="clear formBox">
                <fieldset>
                <legend>Flow Control Settings</legend>
                <div class="clear">
                    <div class="formLabel-labelCell">Capacity:</div>
                    <div class="formLabel-controlCell">
                        <input type="text" id="formAddQueue.queueFlowControlSizeBytes"
                               data-dojo-type="dijit/form/ValidationTextBox"
                               data-dojo-props="
                                  name: 'queueFlowControlSizeBytes',
                                  placeHolder: 'size in bytes',
                                  promptMessage: 'Ceiling (in bytes) at which queue will begin to throttle sessions producing messages',
                                  title: 'Enter the ceiling (in bytes) at which queue will begin to throttle sessions producing messages',
                                  trim: true"/>
                    </div>
                </div>
                <div class="clear">
                    <div class="formLabel-labelCell">Resume Capacity:</div>
                    <div class="formLabel-controlCell">
                        <input type="text" id="formAddQueue.queueFlowResumeSizeBytes"
                               data-dojo-type="dijit/form/ValidationTextBox"
                               data-dojo-props="
                                  name: 'queueFlowResumeSizeBytes',
                                  placeHolder: 'size in bytes',
                                  promptMessage: 'Floor (in bytes) at which queue will cease to throttle sessions producing messages',
                                  title: 'Enter the floor (in bytes) at which queue will cease to throttle sessions producing messages',
                                  trim: true"/>
                    </div>
                </div>
                </fieldset>
                <div class="clear"></div>
            </div>

            <div class="clear formBox">
                <fieldset>
                <legend>Alerting Settings</legend>
                <div class="clear">
                    <div class="formLabel-labelCell">Queue Depth (Messages):</div>
                    <div class="formLabel-controlCell">
                        <input type="text" id="formAddQueue.alertThresholdQueueDepthMessages"
                               data-dojo-type="dijit/form/ValidationTextBox"
                               data-dojo-props="
                                  name: 'alertThresholdQueueDepthMessages',
                                  placeHolder: 'number of messages',
                                  promptMessage: 'Ceiling value for number of messages on queue before alerts will be generated',
                                  title: 'Enter the ceiling value for number of messages on queue before alerts will be generated',
                                  trim: true"/>
                    </div>
                </div>
                <div class="clear">
                    <div class="formLabel-labelCell">Queue Depth (Bytes):</div>
                    <div class="formLabel-controlCell">
                        <input type="text" id="formAddQueue.alertThresholdQueueDepthBytes"
                               data-dojo-type="dijit/form/ValidationTextBox"
                               data-dojo-props="
                                  name: 'alertThresholdQueueDepthBytes',
                                  placeHolder: 'total message size in bytes',
                                  promptMessage: 'Ceiling value (in bytes) for total size of all messages on the queue before alerts will be generated',
                                  title: 'Enter the ceiling value (in bytes) for total size of all messages on the queue before alerts will be generated',
                                  trim: true"/>
                    </div>
                </div>
                <div class="clear">
                    <div class="formLabel-labelCell">Message Age:</div>
                    <div class="formLabel-controlCell">
                        <input type="text" id="formAddQueue.alertThresholdMessageAge"
                               data-dojo-type="dijit/form/ValidationTextBox"
                               data-dojo-props="
                                  name: 'alertThresholdMessageAge',
                                  placeHolder: 'time in ms',
                                  promptMessage: 'Message age (in milliseconds) above which alerts will be generated',
                                  title: 'Enter the message age (in milliseconds) above which alerts will be generated',
                                  trim: true"/>
                    </div>
                </div>
                <div class="clear">
                    <div class="formLabel-labelCell">Message Size:</div>
                    <div class="formLabel-controlCell">
                        <input type="text" id="formAddQueue.alertThresholdMessageSize"
                               data-dojo-type="dijit/form/ValidationTextBox"
                               data-dojo-props="
                                  name: 'alertThresholdMessageSize',
                                  placeHolder: 'message size in bytes',
                                  promptMessage: 'Message size (in bytes) above which alerts will be generated',
                                  title: 'Enter the message size (in bytes) above which alerts will be generated',
                                  trim: true"/>
                    </div>
                </div>
                <div class="clear">
                    <div class="formLabel-labelCell">Gap between alerts:</div>
                    <div class="formLabel-controlCell">
                        <input type="text" id="formAddQueue.alertRepeatGap"
                               data-dojo-type="dijit/form/ValidationTextBox"
                               data-dojo-props="
                                  name: 'alertRepeatGap',
                                  placeHolder: 'time in ms',
                                  promptMessage: 'Minimum time (in milliseconds) between each alert',
                                  title: 'Enter the minimum time (in milliseconds) between each alert.',
                                  trim: true"/>
                    </div>
                </div>
                </fieldset>
                <div class="clear"></div>
            </div>

            <div class="clear formBox">
                <fieldset>
                <legend>Other Settings</legend>
                <div class="clear">
                    <div class="formLabel-labelCell">Maximum Delivery Retries:</div>
                    <div class="formLabel-controlCell">
                        <input type="text" id="formAddQueue.maximumDeliveryAttempts"
                               data-dojo-type="dijit/form/ValidationTextBox"
                               data-dojo-props="
                                  name: 'maximumDeliveryAttempts',
                                  placeHolder: 'number of retries',
                                  promptMessage: 'Maximum number of delivery attempts before the message will be sent to the alternate exchange',
                                  title: 'Enter the maximum number of delivery attempts before the message will be sent to the alternate exchange',
                                  trim: true"/>
                    </div>
                </div>
                <div class="clear">
                    <div class="formLabel-labelCell">Create DLQ?</div>
                    <div class="formLabel-controlCell">
                        <input type="checkbox" id="formAddQueue.dlqEnabled"
                               dojoType="dijit.form.CheckBox"
                               data-dojo-props="
                              name: 'x-qpid-dlq-enabled',
                              value: 'dlqEnabled',
                              title: 'Controls where a dead letter queue is automatically created',
                              checked: false"/>
                    </div>
                </div>

                <div class="clear"></div>
                <div class="infoMessage">Configuring maximum delivery retries on a queue which has no DLQ or alternate <br/>exchange will result in messages being discarded after the limit is reached.</div>

                <div class="clear">
                    <div class="formLabel-labelCell">Message Group Key:</div>
                    <div class="formLabel-controlCell">
                        <input type="text" id="formAddQueue.messageGroupKey"
                               data-dojo-type="dijit/form/ValidationTextBox"
                               data-dojo-props="
                                  name: 'messageGroupKey',
                                  placeHolder: 'message group key',
                                  promptMessage: 'Name of the message property used for message grouping',
                                  title: 'Enter the name of the message property used for message grouping',
                                  trim: true"/>
                    </div>
                </div>
                <div class="clear">
                    <div class="formLabel-labelCell">Shared Message Groups?</div>
                    <div class="formLabel-controlCell">
                        <input type="checkbox" id="formAddQueue.messageGroupSharedGroups"
                               dojoType="dijit.form.CheckBox"
                               data-dojo-props="
                              name: 'messageGroupSharedGroups',
                              value: 'messageGroupSharedGroups',
                              checked: false,
                              title: 'Controls where a shared groups feature is enabled'"/>
                    </div>
                </div>
                </fieldset>
                <div class="clear"></div>
            </div>

          <div class="clear" data-dojo-type="dijit/TitlePane" data-dojo-props="title: 'Context variables',  open: false">
              <div id="formAddQueue.context" ></div>
          </div>

          <div class="dijitDialogPaneActionBar qpidDialogPaneActionBar">
            <!-- submit buttons -->
            <input type="submit" value="Create Queue" label="Create Queue" dojoType="dijit.form.Button" />
          </div>

        </form>
    </div>
</div>
